%  TEST CASE BY HAND

it      = 1; 

%  data format
%    m1
%    g1 -->  D_1  SigR_1  nuSigF_1  xi_1  s_1->s_1 s_2->s_1 ...
%    g2 -->  D_2  SigR_2  nuSigF_2  xi_2  s_1->s_2 s_2->s_2 ...
%    ...
%    m2 ...

dat = [ 1.500   0.030   0.000    1    0.000  0.000  
        0.420   0.080   0.135    0    0.020  0.000
        2.000   0.040   0.000    0    0.000  0.000
        0.300   0.010   0.000    0    0.040  0.000 ]; 
    
numg = 2;  
numm = 2;


% xcm  = [   0   4  8];
% xfm  = [     1   1 ]*10;
% ycm  = [   0   4   8];
% yfm  = [     1   1 ]*10;
% mt   = [ 1 1
%          1 1];       
% src  = [ 0 0;
%          0 0];

% xcm  = [   0   4 ];
% xfm  = [     1   ]*2;
% ycm  = [   0   4   8];
% yfm  = [     1   1 ]*2;
% mt   = [ 1 1];       
% src  = [ 0 0];

% ycm  = [   0   4 ];
% yfm  = [     1   ]*2;
% xcm  = [   0   4   8];
% xfm  = [     1   1 ]*2;
% mt   = [ 1 1]';       
% src  = [ 0 0]';

xcm  = [  0   4   8   12  ]*5;
xfm  = [    1   1   1     ]*10;
ycm  = [  0   4   8   12  ]*5;
yfm  = [    1   1   1     ]*10;
mt   = [ 1 1 2
         1 1 2
         2 2 2];    
     
src(1,:,:)  = [ 0 0 0
                0 0 0 
                0 0 0 ];
src(2,:,:)  = [ 0 0 0
                0 0 0 
                0 0 0 ];
% xcm  = [   0   4 ];
% xfm  = [     2   ];
% ycm  = [   0   4 ];
% yfm  = [     2   ];
% mt   = [ 1];       
% src  = [ 0];    


BCL = 1;
BCR = 0;
BCB = 1;
BCT = 0;           

IBSL = zeros(sum(yfm),2);
IBSR = zeros(sum(yfm),2);
IBSB = zeros(sum(xfm),2);
IBST = zeros(sum(xfm),2);